<template>
  <div>
    <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="60px">
      <el-form-item label="查询栏" prop="boxName">
        <el-input v-model="queryParams.boxName" placeholder="请输入电箱名称" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="" prop="status">
        <el-select v-model="queryParams.status" placeholder="请选择状态" style="width:100%">
          <el-option v-for="(dict, index) in ['下线中', '上线中']" :key="index" :label="dict" :value="index + ''"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" @click="() => $emit('handleQuery', queryParams)">
          搜索
        </el-button>
        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  data () {
    return {
      // 查询参数
      queryParams: {
        boxName: undefined,
        status: undefined,
      },
      nameList: []
    }
  },
  mounted () {
  },
  methods: {
    resetQuery () {
      for (const key in this.queryParams) {
        this.queryParams[key] = null
      }
      this.$emit('handleQuery', this.queryParams)
    }
  }
}
</script>

<style>

</style>